import request from '@/utils/request'
import Order from '@/domain/entity/Order'
import CollectionUtil from '@/framework/infra/collection/CollectionUtil'

export async function queryOrderList (params) {
  const result = await request.post('/admin/order/list', params)
  result.dataList = CollectionUtil.parse(result.dataList, data => {
    return new Order(data)
  })
  return result
}

export async function queryOrdersettleList (params) {
  const result = await request.post('/admin/order/settle_list', params)
  result.dataList = CollectionUtil.parse(result.dataList, data => {
    return new Order(data)
  })
  return result
}
